<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.container {
				width: 100%;
				height: 800px;
				background-color: lightgray;
			}
			
			.mouse {
				width: 100px;
				height: 100px;
				background-color: yellow;
				border-radius: 50px;
				position: relative;
				left: 30px;
				top: 30px;
				text-align: center;
				vertical-align: center;
				line-height: 100px;
			}
			
			.info {
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="mouse">
				<span class="info">0,0</span>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var info = document.querySelector('.info');
		var mouse = document.querySelector('.mouse');
		document.querySelector('.container').onclick = function (e) {
			var x = e.offsetX;
			var y = e.offsetY;
			info.innerHTML = x + ',' + y;
			mouse.style.left =  x + 'px';
			mouse.style.top = y + 'px';
		}
	</script>
</html>
